package com.yc.bran.snack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.bran.snack.bean.Address;
import com.yc.bran.snack.mapper.IAddressMapper;
import com.yc.bran.snack.service.IAddressService;
import com.yc.bran.snack.util.StringUtil;

@Service
public class AddressServiceImpl implements IAddressService {

	@Autowired
	private IAddressMapper addressMapper;
	
	@Override
	public int add(Address ad) {
		if(StringUtil.checkNull(ad.getUid(),ad.getDetailed())) {
			return -100;
		}
		return addressMapper.add(ad);
	}

	@Override
	public List<Address> listaddr(Integer uid) {
		return addressMapper.listaddr(uid);
	}

}
